//  Omnima Limited Copyright (c) 2011
//
//  Targets STM32L and STM32F family MCUs as used 
//  on the omnima-stm32-expander board
//
//  STM32L-Discovery GCC Demo program
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

#ifndef UART_H_
#define UART_H_

#include "platform.h"

uint8_t cmdIsReady();
uint16_t cmdGetLength();
uint8_t* cmdGetBuffer();

void cmdSendAck(uint8_t checksumValue);
void cmdSendAckRet(uint16_t ackValue);
void cmdSendNack(uint8_t expectedChecksum, uint8_t calcChecksum);

unsigned char USART1_ChAvailable();
unsigned char USART1_Getch();

void UART_Init();
int UART_SendChar(char ch, ULONG ud);
void UART_SendData(void*buf,UINT32 len);
void UART_SendString(const char*str);
void UART_printf(const char*str, ...);

#endif /* UART_H_ */
